package com.example.drawex;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class BitmapMatrixActivity extends Activity {

	// 회전 방향에 대한 행렬값
	
	int matX = 1;
	int matY = 1;
	
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_bitmap_matrix);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// TODO Auto-generated method stub
		
		new OptionMenu(this, item);
		
		return super.onOptionsItemSelected(item);
	}
	
	
	public void setMatrix(View v) {
		switch(v.getId()) {
		case R.id.button1:
			matX *= -1;
			break;
		case R.id.button2:
			matY *= -1;
			break;
				
		}
		
		BitmapMatrixView bmv = (BitmapMatrixView)findViewById(R.id.bitmapMatrixView1);
		bmv.setMatrix(matX, matY);
	}

}
